package com.chinasofti.io;

import java.io.*;

public class Demo11 {
    public static void main(String[] args) throws IOException {
        BufferedWriter bw =
                new BufferedWriter(new FileWriter("java419\\bw1.txt"));
        //写数据
        for(int i=0;i<10;i++){
            bw.write("hello"+i);
            bw.newLine(); //bw.write("\r\n")
            bw.flush();
        }
        bw.close();

        BufferedReader br = new BufferedReader(new FileReader("java419\\bw1.txt"));
        String line;
        while ((line = br.readLine()) != null){
            System.out.println(line);
        }
        br.close();


    }
}